﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CategoryList.aspx.cs" Inherits="Smy.Web.Admin.Info.CategoryList" %>

<%@ Import Namespace="Smy.Common" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>后台导航管理</title>
    <link href="../../scripts/artdialog/ui-dialog.css" rel="stylesheet" type="text/css" />
    <link href="../skin/default/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="../../scripts/artdialog/dialog-plus-min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/laymain.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/common.js"></script>
</head>

<body class="mainbody">
    <form id="form1" runat="server">
        <!--导航栏-->
        <div class="location">
            <a href="javascript:history.back(-1);" class="back"><i></i><span>返回上一页</span></a>
            <a href="../center.aspx" class="home"><i></i><span>首页</span></a>
            <i class="arrow"></i>
            <span>内容类别</span>
        </div>
        <!--/导航栏-->

        <!--工具栏-->
        <div id="floatHead" class="toolbar-wrap">
            <div class="toolbar">
                <div class="box-wrap">
                    <a class="menu-btn"></a>
                    <div class="l-list">
                        <ul class="icon-list">
                            <li><a class="add" href="CategoryEdit.aspx?action=<%=STEnums.ActionEnum.Add %>&channel_id=<%=this.channel_id %>"><i></i><span>新增</span></a></li>
                            <li>
                                <asp:LinkButton ID="btnSave" runat="server" CssClass="save" OnClick="btnSave_Click"><i></i><span>保存</span></asp:LinkButton></li>
                            <li><a class="all" href="javascript:;" onclick="checkAll(this);"><i></i><span>全选</span></a></li>
                            <li>
                                <asp:LinkButton ID="btnDelete" runat="server" CssClass="del" OnClientClick="return ExePostBack('btnDelete','本操作会删除本类别及下属子类别，是否继续？');" OnClick="btnDelete_Click"><i></i><span>删除</span></asp:LinkButton></li>
                        </ul>

                        <div class="menu-list">
                            <div class="rule-single-select">
                                <asp:DropDownList ID="ddlCategoryId" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCategoryId_SelectedIndexChanged"></asp:DropDownList>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
        <!--/工具栏-->

        <!--列表-->
        <div class="table-container">
            <asp:Repeater ID="rptList" runat="server" OnItemDataBound="rptList_ItemDataBound">
                <HeaderTemplate>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                        <tr>
                            <th width="6%">选择</th>
                            <th align="left" width="6%">ID</th>
                            <th align="left">栏目标题</th>
                            <th align="left">级别</th>
                            <%--<th align="left" width="12%">调用别名</th>--%>
                            <th align="left" width="12%">排序</th>
                            <th width="12%">操作</th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td align="center">
                            <asp:CheckBox ID="chkId" CssClass="checkall" runat="server" Style="vertical-align: middle;" />
                            <asp:HiddenField ID="hidId" Value='<%#Eval("id")%>' runat="server" />
                            <asp:HiddenField ID="hidLayer" Value='<%#Eval("class_layer") %>' runat="server" />
                        </td>
                        <td><%#Eval("id")%></td>
                        <td>
                            <asp:Literal ID="LitFirst" runat="server"></asp:Literal>
                            <a href="CategoryEdit.aspx?action=<%#STEnums.ActionEnum.Edit %>&channel_id=<%#this.channel_id %>&id=<%#Eval("id")%>"><%#Eval("title")%>
                                 
                            </a>
                        </td>
                        <td><%#Eval("class_layer")%>级</td>
                         
                        <%--<td><%#Eval("call_index")%></td>--%>
                        <td>
                            <asp:TextBox ID="txtSortId" runat="server" Text='<%#Eval("sort_id")%>' CssClass="sort" onkeydown="return checkNumber(event);" /></td>
                        <td align="center">
                            <a href="CategoryEdit.aspx?action=<%#STEnums.ActionEnum.Add %>&channel_id=<%#this.channel_id %>&id=<%#Eval("id")%>">添加子类</a>
                            <a href="CategoryEdit.aspx?action=<%#STEnums.ActionEnum.Edit %>&channel_id=<%#this.channel_id %>&id=<%#Eval("id")%>">修改</a>
                        </td>
                    </tr>
                </ItemTemplate>
                
                <FooterTemplate>
                    <%#rptList.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"6\">暂无记录</td></tr>" : ""%>

            </table>
                </FooterTemplate>
            </asp:Repeater>
            
        </div>
        <!--/列表-->
       
    </form>
  
     <%if (is_super_admin == 1) {%>
        <br />
        <%if(parent_id>0){ %>
        <div style="font-size: 12px;color: #333;line-height: 28px;">获取“<span style="color:red;"><%=ddlCategoryId.SelectedItem.Text.Replace("　├ ","") %></span>”栏目的标题：
        <br />&lt;%=get_category_title(<%=parent_id %>,"");%&gt;</div>

        <div style="font-size: 12px;color: #333;line-height: 28px;">获取“<span style="color:red;"><%=ddlCategoryId.SelectedItem.Text.Replace("　├ ","") %></span>”栏目的实体：
        <br />&lt;%Smy.Model.InfoCategory cmodel = get_category_model(<%=parent_id %>);%&gt;
            <br />&lt;!-- &lt;%=cmodel.变量%&gt; --&gt;
            <br />&lt;%=cmodel.title%&gt;
        </div>
        <%} %>
        <div style="font-size: 12px;color: #333;line-height: 28px;">获取“<span style="color:red;"><%=ddlCategoryId.SelectedItem.Text.Replace("　├ ","") %></span>”栏目的所有子栏目：
        <br />&lt;%DataTable nlist=get_category_list("<%=channel_name %>",<%=parent_id %>);%&gt;
         <br />&lt;%foreach(DataRow dr in nlist.Rows){%&gt;
        <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 子栏目标题：&lt;%=dr[&quot;title&quot;]%&gt;
        <br /> &lt;%}%&gt;
        </div>
        <div style="font-size: 12px;color: #333;line-height: 28px;">获取“<span style="color:red;"><%=ddlCategoryId.SelectedItem.Text.Replace("　├ ","") %></span>”栏目的所有直接子栏目：
        <br />&lt;%DataTable nlist=get_category_child_list("<%=channel_name %>",<%=parent_id %>);%&gt;
         <br />&lt;%foreach(DataRow dr in nlist.Rows){%&gt;
        <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 子栏目标题：&lt;%=dr[&quot;title&quot;]%&gt;
        <br /> &lt;%}%&gt;
        </div>

    <%} %>
</body>
</html>
